package philbot;

import java.util.List;

/*
 * Abstract class to define a "position" in the game
 * The assumption is that positions are immutable. 
 * 
 * Two design choices are important here:
 * 1. Implementing my own position stack.  
 * 	Rather than using an existing position I decided to implement my own
 * 	This allows a better understanding of the performance characteristics.
 * 	Later versions of the game will want to use a bit-board representation for example
 * 	It also means that porting the code to a different language should not be that hard.
 * 
 * 2. Using an abstract class.
 * 	It is important to be able to right different implementations of the position
 * 	First, it is essential that I be able to handle multiple board sizes
 * 	Second, I want to try out multiple implementations of the board
 * 	An abstract class might latter make code simpler than using an interface, but does not cost anything in this case
 */
public abstract class AbstractPosition {
	/**
	 * Returns a collection of possible next positions.  Assumes no ordering.
	 * @return a collection of positions reachable in a single turn from this one
	 */
	abstract public List<AbstractPosition> getChildren();
	/**
	 * Evaluates the quality of the current position
	 * @param e an Evaluator
	 * @return the value of the position.
	 */
	abstract public int eval(Evaluator e);
	
	/**
	 * @return True if the position is a victory for either side
	 */
	abstract public boolean isVictory();
	/**
	 * @return 0 if the position is not a victory for either side
	 * @return positive if it is a victory in the "up" direction
	 * @return negative if it is a victory in the "down" direction"
	 */
	abstract public int whoVictory();
	/**
	 * @return whas this position created by jumping?
	 */
	abstract public boolean createdByJump();
	//abstract public boolean side();
}
